When configuring the inspector display, preserve
debug flags that affect which GL variant we pick.
Otherwise, we may end up with a GLX context on the
default display, and an EGL context on the inspector
one. This hopelessly confuses libepoxy, and things
don't go well when that happens.
if (display)
{
const char *name;
+ GdkDebugFlags flags;
name = g_getenv ("GTK_INSPECTOR_RENDERER");
g_object_set_data_full (G_OBJECT (display), "gsk-renderer",
g_strdup (name), g_free);
- gdk_display_set_debug_flags (display, 0);
+ flags = gdk_display_get_debug_flags (gdk_display_get_default ());
+
+ gdk_display_set_debug_flags (display, flags & (GDK_DEBUG_GL_GLES | GDK_DEBUG_GL_GLX));
gtk_set_display_debug_flags (display, 0);
}